package com.scrawler.util;



import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;


/**  
 * @Description: 描述  各个频道中，文章标题不允许出现的禁词
 * @author kuntang    
 * @version 1.0  
 * @created 2013-1-22 下午3:00:34 
 * Copyright (c) 2013 sohu,Inc. All Rights Reserved.
 */

public abstract class ForbiddenTitleWord {

	private static Map<Integer,Set<String>> forbiddenWordGroup =new HashMap<Integer,Set<String>>();
	static{
		Set<String> nbaForbiddenWords = new HashSet<String>();
		nbaForbiddenWords.add("直播实录");
	}
	

	public static boolean containsForbiddenWord(int channelId,String title){
		boolean flag = false;
		Set<String> forbidenSource = forbiddenWordGroup.get(channelId);
		if(title == null){
			return flag;
		}
		if(forbidenSource != null){
			for(String key : forbidenSource){
				if(title.contains(key)){
					flag = true;
					break;
				}
			}
		}
		return flag;
	}
	
	
	public static void main(String args[]){
		boolean flag = ForbiddenTitleWord.containsForbiddenWord(24, "直播实录");
		System.out.println(flag);
	}
	
}
